#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N], cnt[32][2];
long long ans;
void insert(int x) {
  for (int i = 0; i <= 30; ++i) {
    int t = !!((1LL << i) & x);
    ans += (1LL << i) * cnt[i][!t];
    cnt[i][t]++;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    a[i] = x ^ a[i - 1];
  }
  // starts from 0
  for (int i = 0; i <= n; ++i) insert(a[i]);

  printf("%lld\n", ans);
}
